home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programmer Power Tools
/
Programmer Power Tools.iso
/
progjrn
/
pj_7_3a.arc
/
KEYBOARD.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1989-02-20
|
505b
|
30 lines
// keyboard.cpp Keyboard class non-inline mehtods.
//
// (c) Aspen Scientific 1989. All Rights Reserved.
// Author: Vaughn Vernon
#include "keyboard.cls"
#include <dos.h>
#include <conio.h>
static union REGS kRegs;
int
Keyboard::input(int wait)
{
if (!wait && !kbhit())
return (keyI = -1);
kRegs.h.ah = 0;
int86(0x16, &kRegs, &kRegs);
if (kRegs.h.al != 0)
keyI = kRegs.h.al; // regular key
else
keyI = kRegs.h.ah | extMask; // extended key
return keyI;
}